/**
 * 先按cilckCount，再按orderCount，再按payCount排序
 * @param clickCount
 * @param orderCount
 * @param payCount
 */
case class SortKey(clickCount:Long,orderCount:Long,payCount:Long) extends Ordered[SortKey]{
  // 相当于this.compare(that) ,that是新传进来进行比较的值
  // comper >0 代表this>that
  // comper <0 代表this<that
  // compare默认自然续排序，也就是数>0时 1->2 大的在后面
  override def compare(that: SortKey): Int = {
    // 判断
    if(this.clickCount-that.clickCount!=0){
      return (this.clickCount-that.clickCount).toInt

    }else if(this.orderCount-that.orderCount!=0){
      return (this.orderCount-that.orderCount).toInt

    }else {
      return (this.payCount-that.payCount).toInt
    }

  }
}
